package com.uchiha.nova.core.tool.constant;

import java.util.ArrayList;
import java.util.List;

/**
 * @author 周林静
 * @Date 2021/4/29 16:36
 * @Version 1.0
 */
public class AuthProvider {
    public static final String TARGET = "/**";
    public static final String REPLACEMENT = "";
    public static final String AUTH_KEY = "nova-auth";
    public static final String AUTHORIZATION = "Authorization";
    private static final List<String> DEFAULT_SKIP_URL = new ArrayList<>();

    static {

        DEFAULT_SKIP_URL.add("/uaaa/oauth/token/**");
        DEFAULT_SKIP_URL.add("/uaaa/oauth/token");
        DEFAULT_SKIP_URL.add("/uaaa/oauth/captcha/**");
        DEFAULT_SKIP_URL.add("/uaaa/oauth/clear-cache/**");
        DEFAULT_SKIP_URL.add("/uaaa/oauth/user-info");
        DEFAULT_SKIP_URL.add("/uaaa/oauth/render");
        DEFAULT_SKIP_URL.add("/uaaa/oauth/callback");
        DEFAULT_SKIP_URL.add("/uaaa/oauth/revoke");
        DEFAULT_SKIP_URL.add("/uaaa/oauth/refresh");
        DEFAULT_SKIP_URL.add("/token/**");
        DEFAULT_SKIP_URL.add("/actuator/health/**");
        DEFAULT_SKIP_URL.add("/v2/api-docs/**");
        DEFAULT_SKIP_URL.add("/v2/api-docs-ext/**");
        DEFAULT_SKIP_URL.add("/auth/**");
        DEFAULT_SKIP_URL.add("/log/**");
        DEFAULT_SKIP_URL.add("/menu/routes");
        DEFAULT_SKIP_URL.add("/menu/auth-routes");
        DEFAULT_SKIP_URL.add("/menu/top-menu");
        DEFAULT_SKIP_URL.add("/error/**");
        DEFAULT_SKIP_URL.add("/assets/**");
    }

    /**
     * 默认无需鉴权的API
     */
    public static List<String> getDefaultSkipUrl() {
        return DEFAULT_SKIP_URL;
    }
}
